package com.yanqu.road.server.manger;

import com.yanqu.road.logic.bussiness.servercenter.PlatformUserIdInfoBussiness;
import com.yanqu.road.server.TempMgr;

import java.util.ArrayList;
import java.util.List;

public class TokenOrderWhiteMgr extends TempMgr {

	private static List<Long> whiteUserIdList = new ArrayList<>();

	@Override
	public boolean init() throws Exception {
		return reload();
	}

	@Override
	public boolean stop() {
		return false;
	}

	@Override
	public boolean save() {
		return false;
	}

	@Override
	public boolean reloadData() {
		whiteUserIdList = PlatformUserIdInfoBussiness.getTokenWhiteUserIdList();
		return true;
	}

	@Override
	public boolean reloadConfig() throws Exception {
		return true;
	}

	public static boolean isTokenOrderWhite(long userId) {
		return whiteUserIdList.contains(userId);
	}
}